package com.eatsystem.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eatsystem.entity.AddressBook;
import com.eatsystem.mapper.AddressBookMapper;
import com.eatsystem.service.AddressBookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class AddressBookServiceImpl extends ServiceImpl<AddressBookMapper, AddressBook> implements AddressBookService {

    //根据id删除地址
    @Override
    public void deleteAddress(Long ids) {
        //构造查询条件
        //LambdaQueryWrapper<AddressBook> queryWrapper = new LambdaQueryWrapper<>();
        //queryWrapper.eq(AddressBook::getId,ids);
        //查找需要删除地址的对应的id
        this.removeById(ids);
    }

    //更新用户地址
    @Override
    public void updateAddress(AddressBook addressBook) {
        this.updateById(addressBook);
    }
}
